字体重量

您所在的位置:网站首页 font weight翻译 字体重量

字体重量

2024-07-14 17:48| 来源: 网络整理| 查看: 265

排版

字体重量

用于控制元素字体粗细的工具。

​Quick referenceClassPropertiesfont-thinfont-weight: 100; font-extralightfont-weight: 200; font-lightfont-weight: 300; font-normalfont-weight: 400; font-mediumfont-weight: 500; font-semiboldfont-weight: 600; font-boldfont-weight: 700; font-extraboldfont-weight: 800; font-blackfont-weight: 900; ​基本用法

¥Basic usage

​设置字体粗细

¥Setting the font weight

使用 font-* 工具来控制元素的字体粗细。

¥Use the font-* utilities to control the font weight of an element.

font-light

The quick brown fox jumps over the lazy dog.

font-normal

The quick brown fox jumps over the lazy dog.

font-medium

The quick brown fox jumps over the lazy dog.

font-semibold

The quick brown fox jumps over the lazy dog.

font-bold

The quick brown fox jumps over the lazy dog.

The quick brown fox ... The quick brown fox ... The quick brown fox ... The quick brown fox ... The quick brown fox ... ​有条件地应用 ​悬停、聚焦和其他状态

Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:font-bold to only apply the font-bold utility on hover.

For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.

​断点和媒体查询

You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:font-bold to apply the font-bold utility at only medium screen sizes and above.

To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.

​使用自定义值

¥Using custom values

​自定义主题

¥Customizing your theme

默认情况下,Tailwind 提供九个 font-weight 工具。你可以通过编辑 Tailwind 配置的 theme.fontWeight 部分来更改、添加或删除它们。

¥By default, Tailwind provides nine font-weight utilities. You change, add, or remove these by editing the theme.fontWeight section of your Tailwind config.

tailwind.config.jsmodule.exports = { theme: { fontWeight: { thin: '100', hairline: '100', extralight: '200', light: '300', normal: '400', medium: '500', semibold: '600', bold: '700', extrabold: '800', 'extra-bold': '800', black: '900', } } }

在 主题定制 文档中了解有关自定义默认主题的更多信息。

¥Learn more about customizing the default theme in the theme customization documentation.

​任意值

¥Arbitrary values

If you need to use a one-off font-weight value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.

Learn more about arbitrary value support in the arbitrary values documentation.

字体样式字体变体数字

Tailwind CSS 中文网 - 粤ICP备13048890号

目录Quick reference基本用法设置字体粗细有条件地应用悬停、聚焦和其他状态断点和媒体查询使用自定义值自定义主题任意值


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3